package com.accedo.achievements.dataaccess.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.stereotype.Component;

@Component
@Entity
@Table(name="t_achievement")
public class Achievement implements Serializable {
	
	private static final long serialVersionUID = -6657186842063476579L;
	private int id; //generated by native
	private String app_sn; //unique & not-null
	private String achi_sn; //unique & not-null
	private String achi_name; //not-null
	private long achi_score; //not-null
	private String achi_desc;
	private String card_sn; //not-null
	
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@Column(nullable=false)
	public String getApp_sn() {
		return app_sn;
	}
	public void setApp_sn(String app_sn) {
		this.app_sn = app_sn;
	}
	
	@Column(unique=true,
			nullable=false)
	public String getAchi_sn() {
		return achi_sn;
	}
	public void setAchi_sn(String achi_sn) {
		this.achi_sn = achi_sn;
	}
	
	@Column(nullable=false)
	public String getAchi_name() {
		return achi_name;
	}
	public void setAchi_name(String achi_name) {
		this.achi_name = achi_name;
	}
	
	@Column(nullable=true)
	public String getAchi_desc() {
		return achi_desc;
	}
	public void setAchi_desc(String achi_desc) {
		this.achi_desc = achi_desc;
	}
	
	@Column(nullable=false)
	public String getCard_sn() {
		return card_sn;
	}
	public void setCard_sn(String card_sn) {
		this.card_sn = card_sn;
	}
	
	@Column(nullable=false)
	public long getAchi_score() {
		return achi_score;
	}
	public void setAchi_score(long achi_score) {
		this.achi_score = achi_score;
	}

}
